package com.duguo.dynamicmvc.view.resolver;

import com.duguo.dynamicmvc.view.View;

public class ViewResolverImpl implements ViewResolver {

	private ViewResolver _dynamicViewResolver;
	private ViewResolver _staticViewResolver;

	public View resolve(String viewName) {
		View view=_dynamicViewResolver.resolve(viewName);
		if(view==null){
			view=_staticViewResolver.resolve(viewName);
		}
		return view;
	}

	public void setDynamicViewResolver(ViewResolver dynamicViewResolver) {
		_dynamicViewResolver = dynamicViewResolver;
	}

	public void setStaticViewResolver(ViewResolver staticViewResolver) {
		
		_staticViewResolver = staticViewResolver;
	}
	

}
